package com.googlecode.stemwijzer.server.modules;

import org.codehaus.jackson.map.ObjectMapper;

import com.google.inject.AbstractModule;
import com.google.inject.servlet.SessionScoped;
import com.googlecode.stemwijzer.client.StemwijzerService;
import com.googlecode.stemwijzer.server.session.ServerSession;

/**
 * The module class provides the place where the mapping is made between properties, classes or files and such that
 * are to be injected to their actual instances.
 * 
 * @author roel.hodzelmans
 */
public class StemwijzerModule extends AbstractModule {

	/**
	 * Binds the interfaces to the implementations. {@inheritDoc}
	 * 
	 * @see com.google.inject.AbstractModule#configure()
	 */
	@Override
	protected void configure() {
		super.bind(ServerSession.class).in(SessionScoped.class);
		super.bind(ObjectMapper.class).toInstance(new ObjectMapper());
		super.bind(StemwijzerService.class).toProvider(StemwijzerProvider.class);
	}
}
